home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / dos / diverses / cexpress / system / gameport.asm < prev    next >
Encoding:
Assembly Source File  |  1989-05-03  |  485 b   |  23 lines

  1. ;char  game_port();
  2.  
  3.     EXTRN  _memory_model:byte
  4.  
  5. _TEXT    SEGMENT BYTE PUBLIC 'CODE'
  6.     ASSUME CS:_TEXT
  7.     PUBLIC _game_port
  8. _game_port proc near
  9.     sub  bl,bl        ;return value
  10.     mov  dx,201H        ;game port address
  11.     in   al,dx        ;get value
  12.     test al,0fh        ;test for presence
  13.     jnz  L1            ;jump if no port
  14.     inc  bl            ;else return 1
  15. L1:    mov  al,bl        ;set return value
  16.     cmp  _memory_model,0    ;quit
  17.     jle  Quit        ;
  18.     db   0CBh        ;RET far
  19. Quit:    ret            ;RET near
  20. _game_port endp
  21. _TEXT    ENDS
  22.     END
  23.